package dao.jpa;

import java.util.List;

import vo.Opinion;
import vo.Paper;
import vo.Sentence;
import dao.OpinionDAO;

public class OpinionDAOJpaImpl extends GenericDaoJpaImpl<Opinion, Long> implements OpinionDAO {

	public OpinionDAOJpaImpl() {
		super(Opinion.class);
	}

	public List<Opinion> findAll() {
		return super.executeFinder("Opinion.findAll");
	}

	public List<Opinion> findAll(int start, int pageSize) {
		return super.executeFinderPage("Opinion.findAll", start, pageSize);
	}

	public long findTotalCount() {
		return super.executeFinderCount("Opinion.findTotalCount");
	}
	public List<Opinion> findByPaperId(int start, int pageSize,long paperId) {
		return super.executeFinderPage("Opinion.findByPaperId", start, pageSize,paperId);
	}

	public long findTotalCountByPaperId(long paperId) {
		return super.executeFinderCount("Opinion.findTotalCountByPaperId",paperId);
	}

	//类型分页
	public List<Opinion> findByType(int start, int pageSize,long type) {
		return super.executeFinderPage("Opinion.findByType", start, pageSize,type);
	}

	public long findTotalCountByType(long type) {
		return super.executeFinderCount("Opinion.findTotalCountByType",type);
	}

	//关键字分页
	public List<Opinion> findByKeyword(int start, int pageSize,String keyword) {
		return super.executeFinderPage("Opinion.findByKeyword", start, pageSize,keyword);
	}

	public long findTotalCountByKeyword(String keyword) {
		return super.executeFinderCount("Opinion.findTotalCountByKeyword",keyword);
	}
	//type,关键字分页
	public List<Opinion> findByTypeKeyword(int start, int pageSize,long type,String keyword) {
		return super.executeFinderPage("Opinion.findByTypeKeyword", start, pageSize,type,keyword);
	}

	public long findTotalCountByTypeKeyword(long type,String keyword) {
		return super.executeFinderCount("Opinion.findTotalCountByTypeKeyword",type,keyword);
	}

}
